// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   XYValueSeries.java

package org.achartengine.model;

import java.util.ArrayList;
import java.util.List;

// Referenced classes of package org.achartengine.model:
//			XYSeries

public class XYValueSeries extends XYSeries
{

	private List mValue;
	private double mMinValue;
	private double mMaxValue;

	public XYValueSeries(String s)
	{
		super(s);
		mValue = new ArrayList();
		mMinValue = 1.7976931348623157E+308D;
		mMaxValue = -1.7976931348623157E+308D;
	}

	public synchronized void add(double d, double d1, double d2)
	{
		super.add(d, d1);
		mValue.add(Double.valueOf(d2));
		updateRange(d2);
	}

	private void initRange()
	{
		mMinValue = 1.7976931348623157E+308D;
		mMaxValue = 1.7976931348623157E+308D;
		int i = getItemCount();
		for (int j = 0; j < i; j++)
			updateRange(getValue(j));

	}

	private void updateRange(double d)
	{
		mMinValue = Math.min(mMinValue, d);
		mMaxValue = Math.max(mMaxValue, d);
	}

	public synchronized void add(double d, double d1)
	{
		add(d, d1, 0.0D);
	}

	public synchronized void remove(int i)
	{
		super.remove(i);
		double d = ((Double)mValue.remove(i)).doubleValue();
		if (d == mMinValue || d == mMaxValue)
			initRange();
	}

	public synchronized void clear()
	{
		super.clear();
		mValue.clear();
		initRange();
	}

	public synchronized double getValue(int i)
	{
		return ((Double)mValue.get(i)).doubleValue();
	}

	public double getMinValue()
	{
		return mMinValue;
	}

	public double getMaxValue()
	{
		return mMaxValue;
	}
}
